package com.eidos.blogs.openapi.service.seckill;

import com.eidos.blogs.openapi.dto.secKill.GenerateRedEnvelopeDto;
import com.eidos.blogs.openapi.dto.secKill.RedEnvelopeDto;
import com.eidos.blogs.openapi.entity.seckill.RedeInfo;
import com.eidos.blogs.openapi.entity.seckill.RedeReceiveRecord;
import com.eidos.blogs.openapi.rest.Resp;
import com.eidos.blogs.openapi.vo.secKill.redenvelope.RedEnvelopeVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * @author ： Eidos
 * @date ：Created in 2021-01-11
 * @description：红包信息表 服务类
 * @modified By：
 * @version: 1.0
 */
public interface IRedEnvelopesService extends IService<RedeInfo> {

    /**
     * 生成红包
     *
     * @param redEnvelopeDto
     * @return
     */
    Resp<Boolean> generateRedEnvelope(GenerateRedEnvelopeDto redEnvelopeDto);

    /**
     * 删除红包
     *
     * @param redEnvelopeDto
     * @return
     */
    Resp<Boolean> deleteRedEnvelope(GenerateRedEnvelopeDto redEnvelopeDto);

    /**
     * 并发一次性抢红包
     *
     * @param redEnvelopeDto
     * @return
     */
    Resp<Long> grabConcurrent(RedEnvelopeDto redEnvelopeDto);

    /**
     * 领取红包
     *
     * @param redEnvelopeDto
     * @return
     */
    Resp<RedEnvelopeVo> receiveRedEnvelope(RedEnvelopeDto redEnvelopeDto);


    Resp<RedEnvelopeVo> getRedEnvelope(RedEnvelopeDto dto);

    Resp<List<RedeReceiveRecord>> queryRedeReceiveRecordListByRedEnvelopeId(GenerateRedEnvelopeDto dto);

}
